import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

// 根据派单ID获取所有从属工单ID
export const getWorkRecordsByDispatchId = (id) => {
  return request.get(`/admin/repairRecord/getWorkRecords/` + id);
}

// 修改指定ID的报修记录
export const updateRepairRecordById = (id, repairData) => {
  return request.put(`/admin/repairRecord/` + id , repairData);
}

// 根据ID查询报修记录
export const getRepairRecordById = (id) => {
  return request.get(`/admin/repairRecord/` + id );
}

// 分页查询报修记录
export const getRepairRecordPage = (params) => {
  return request.get('/admin/repairRecord/page', { params: params });
}

// 完成某一报修记录审核
export const verifyRepairRecord = (id) => {
  return request.post(`/admin/repairRecord/verify/` + id );
}